package com.shensi.api.admin.client.station;

import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.station.dto.CommodityManagementDto;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysLogininforClientFallBack.class)
@Component
public interface CommodityManagementClient {

    /**
     * 分页查询
     *
     * @param commodityManagement 筛选条件
     * @return 查询结果
     */
    @PostMapping("/commodityManagement/list")
    public TableDataInfo queryByPage(@RequestBody CommodityManagementDto commodityManagement);
    /**
     * 查询统计数量
     *
     * @param commodityManagement 筛选条件
     * @return 查询结果 statisticsData
     */
    @PostMapping("/commodityManagement/getStatisticsData")
    public AjaxResult getStatisticsData(@RequestBody CommodityManagementDto commodityManagement);

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("/commodityManagement/queryById/{id}")
    public AjaxResult queryById(@PathVariable("id") Long id);

    /**
     * 新增数据
     *
     * @param commodityManagement 实体
     * @return 新增结果
     */
    @PostMapping("/commodityManagement/add")
    public AjaxResult add(@RequestBody CommodityManagementDto commodityManagement);

    /**
     * 编辑数据
     *
     * @param commodityManagement 实体
     * @return 编辑结果
     */
    @PostMapping("/commodityManagement/edit")
    public AjaxResult edit(@RequestBody CommodityManagementDto commodityManagement);

    /**
     * 删除数据
     *
     * @param ids 主键
     * @return 删除是否成功
     */
    @PostMapping("/commodityManagement/delete")
    public AjaxResult delete(@RequestBody List<Long> ids);

}
